// pages/habbits/exercise/exercise.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
      count : 0,
      lastDakaDate : ""
  },

  daka: function(){
    console.log("早起打卡")
    this.setData({
      count : this.data.count+1,
      lastDakaDate : new Date().toDateString()
    })
    wx.setStorageSync('getupData', {
      count : this.data.count,
      lastDakaDate : this.data.lastDakaDate
    })
  },

  loadLocalData: function(){
    const localData = wx.getStorageSync('getupData')||{}
    this.setData({
      count : localData.count || 0,
      lastDakaDate : localData.lastDakaDate || ""
      }
    )
  },

  onLoad(options) {
    this.loadLocalData()
  },

  

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})